package com.honghu.villagepost.adapter

import com.honghu.villagepost.R
import com.honghu.villagepost.entity.Addr
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

/**
 * @author: mqwang
 * @create: 2/10/21 12:11 AM
 * @Description:
 */
class AddrAdapter : BaseQuickAdapter<Addr, BaseViewHolder>(R.layout.adapter_addr) {

    override fun convert(helper: BaseViewHolder, item: Addr) {
        helper!!.setText(R.id.tv_name, item.name + "   " + item.mobile)
        helper!!.setText(R.id.tv_addr, item.province+item.city+item.district+item.street+item.address)

        if (item.defaultAddr){
            helper.setGone(R.id.tv_default, true)
        }else{
            helper.setGone(R.id.tv_default, false)
        }

        helper.addOnClickListener(R.id.tv_edit).addOnClickListener(R.id.tv_delete)

    }
}